/*
 * @Author: HeAo
 * @Date: 2021-09-26 16:42:24
 * @LastEditTime: 2021-09-26 16:58:32
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\3-1-ES6\day02\9-数组API.js
 * 别乱动！
 */
let arrObj = {
  0: 'tom',
  1: 'terry',
  2: 'jacky',
  length: 3
}

// let arr = Array.from(arrObj)
// let arr = Array.from('hello')
// let arr = Array.from({ name: 'zhangsan', gae: 12 })
// console.log(arr);

// 创建数组
let arr1 = new Array(1, 2, 3, 4, 5, 6)  // [1,2,3]
let arr2 = new Array(3)  // [empty,empty,empty]
// console.log(arr1, arr2);
let arr3 = Array.of(3, true, 'str') // [3]
// console.log(arr3);

let result = arr1.findIndex((item, index) => {
  return item > 3
})
// console.log(result);

let result1 = arr1.includes(1)
// console.log(result1);

let result2 = arr1.fill(7)
console.log(result2, arr1, result2 === arr1);